<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>6.数据类型-简单数据类型-获取变量数据类型</title>
    <script>
        var num = 10;
        console.log(typeof num);// number 数字型
        var str = 'web';
        console.log(typeof str);// string 字符串型
        var flag = true;
        console.log(typeof flag);//boolean 布尔型
        var vari = undefined;
        console.log(typeof vari);//undefined 未定义类型
        var timer = null;
        console.log(typeof timer);//object类型

        var age = prompt('请输入您的年龄');
        console.log(age);
        console.log(typeof age);//检测出来值是 字符串型的
    </script>
</head>

<body>

</body>

</html>